#include "guiterm.hpp"
#ifndef TERMINALWINDOW_HPP
#define TERMINALWINDOW_HPP
#include <QMainWindow>
#include <QTabWidget>
#include <QMenu>
#include <QShortcut>

class TerminalWindow
	:public QMainWindow
{
	Q_OBJECT
public:
	TerminalWindow();
	~TerminalWindow();
	
	void addTab(Tab *tab);
	void removeTab(Tab *tab);
	Tab *getCurrentTab();
	vector<Tab*> getTabs();
	
	void tabNameChanged(Tab *tab);
	
	void giveFocus();
	
	bool globalHotkey(QKeyEvent *event);
	
public slots:
	// Tabs menu
	void openTabMenu();
	void createTab();
	void nextTab();
	void prevTab();
	void lastTab();
	void changeTab(int index);
	void tabChanged(int index);
	
	void helpAbout();
	
protected:
	void keyPressEvent(QKeyEvent *event);
	
	void setupLayout();
	void setupActions();
	void setupMenus();
	
	QTabWidget *tabs;
	Tab *currentTab;
	Tab *previousTab;
	
	QMenu *fileMenu;
		QAction *exitAct;
	TabMenu *tabMenu;
	QMenu *helpMenu;
		QAction *helpAboutAct;
};

#endif
